#!/bin/bash

declare -A exts

for f in $(find . -type f | xargs basename -a)
do
  # echo "$f"

  ext=${f##*.}
  # 判断扩展名是否已经存在
  if [[ "${exts[@]}" =~ "${ext}" ]]
  then
    continue
  else
    idx=$(( ${#exts[@]} ))
    exts[${idx}]="${ext}"
    idx=$(( ${idx} + 1 ))
  fi
done

# 输出
for ext in ${exts[@]}
do 
  echo ${ext}
done
